extends ../layout

block main
	ul.breadcrumb
		li
			i.icon-home
		li
			i.icon-angle-right
		li
			a(href="/") 面板


	div(class="row-fluid sortable")
		div(class="box span12")
			div(class="box-header", data-original-title)
				h2
					i(class="halflings-icon user")
					span.break
					| 商户

			div.box-content
				table(class="table table-striped table-bordered bootstrap-datatable datatable")
					thead
						tr
							th 名字
							th LOGO
							th 地址
							th 状态
							th
					tbody
						- var states = ["申请中", "申请成功", "申请失败", "禁止中"]
						- each merchant in merchants
							tr
								td
									a(href="/merchants/#{merchant.id}") #{merchant.get('name')}
								td
									img(src="#{merchant.get('logo')}", width=50, height=50)
								td= merchant.get('address')
								td= states[merchant.get('state')]
								td.center
									a(class="btn btn-info", href="/merchants/#{merchant.id}/edit?app=#{app}")
										i(class="halflings-icon white edit")